var http = require('http')

var server = http.createServer()

server.on('request', function (req, res) {
    var url = req.url
    if (url == '/plain'){
        res.setHeader('Content-type', 'text/plain; charset=utf-8');
        res.end('hello 福州阿柯');
    } else if(url == '/html'){
        res.setHeader('Content-type', 'text/html; charset=utf-8');
        res.end('<p><a href="#">hello </a>福州阿柯</p>')
    }else{
        res.end('404 not fount')
    }
})

server.listen(3000, function () {
    console.log('server is running')
})